﻿<UserControl
    x:Class="BombaJob.Views.OfferDetailsView"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
    xmlns:mah="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
    xmlns:properties="clr-namespace:BombaJob.Properties" 
    xmlns:cal="clr-namespace:Caliburn.Micro;assembly=Caliburn.Micro"
    mc:Ignorable="d" 
    d:DesignHeight="600"
    d:DesignWidth="600">
    
    <UserControl.Resources>
        <Style TargetType="{x:Type TextBox}">
            <Setter Property="Background" Value="Transparent" />
            <Setter Property="BorderThickness" Value="0" />
            <Setter Property="IsReadOnly" Value="True" />
            <Setter Property="TextWrapping" Value="Wrap" />
        </Style>
    </UserControl.Resources>

    <mah:MetroContentControl>
        <ScrollViewer>
            <ScrollViewer.ContextMenu>
                <ContextMenu cal:Action.TargetWithoutContext="{Binding Path=PlacementTarget.Tag, RelativeSource={RelativeSource Self}}">
                    <MenuItem Header="{x:Static properties:Resources.ctxmenu_SendMessage}"
                                  cal:Message.Attach="OffersList_Menu_Message($dataContext)"/>
                    <Separator />
                    <MenuItem Header="{x:Static properties:Resources.share_Facebook}"
                                              cal:Message.Attach="OffersList_Menu_ShareFacebook($dataContext)"/>
                    <MenuItem Header="{x:Static properties:Resources.share_Twitter}"
                                              cal:Message.Attach="OffersList_Menu_ShareTwitter($dataContext)"/>
                </ContextMenu>
            </ScrollViewer.ContextMenu>
            <Grid HorizontalAlignment="Stretch" VerticalAlignment="Stretch" ScrollViewer.CanContentScroll="True" ScrollViewer.VerticalScrollBarVisibility="Auto">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                
                <TextBox Grid.Row="0" Text="{Binding Path=CurrentJobOffer.Title}" Foreground="#FF000000" FontSize="24" Margin="20,0,0,10" />
                <TextBox Grid.Row="1" Text="{Binding Path=CurrentJobOffer.PublishDate, Converter={StaticResource OfferDateLongConverter}}" Foreground="#FF000000" FontSize="20" Margin="20,0,0,0" />
                <TextBox Grid.Row="2" Text="{Binding Path=CurrentJobOffer.CategoryTitle}" Foreground="#FF000000" FontSize="20" Margin="20,10,0,0" />
                
                <StackPanel Grid.Row="3" Orientation="Horizontal" VerticalAlignment="Top" Margin="20,10,0,0">
                    <TextBox Text="{x:Static properties:Resources.offer_FreelanceYn}" Foreground="#FF000000" FontSize="20" />
                    <TextBox Text="{Binding Path=CurrentJobOffer.FreelanceYn, Converter={StaticResource YesNoConverter}}" Foreground="#FF000000" FontSize="20" Margin="10,0,0,0" />
                </StackPanel>
                
                <TextBox Grid.Row="4" Name="txtPositiv" Text="{Binding OfferPositiv}" Foreground="#FF000000" FontSize="20" FontWeight="Bold" Margin="20,20,20,0" />
                <FlowDocumentScrollViewer Grid.Row="5" Name="FDOfferNegativ" Tag="{Binding DataContext, ElementName=CurrentJobOffer.Negativism}"
                                          Document="{Binding Path=CurrentJobOffer.Negativism, Converter={StaticResource HTMLtoFDConverter}}"
                                          Foreground="#FF000000" FontSize="24" BorderBrush="Transparent" BorderThickness="0" Margin="0">
                    <FlowDocumentScrollViewer.ContextMenu>
                        <ContextMenu>
                            <MenuItem Header="{x:Static properties:Resources.ctxmenu_Copy}" Command="Copy"/>
                            <MenuItem Header="{x:Static properties:Resources.ctxmenu_SendMessage}"
                                      cal:Message.Attach="OffersList_Menu_Message()"/>
                            <Separator />
                            <MenuItem Header="{x:Static properties:Resources.share_Facebook}"
                                              cal:Message.Attach="OffersList_Menu_ShareFacebook($dataContext)"/>
                            <MenuItem Header="{x:Static properties:Resources.share_Twitter}"
                                              cal:Message.Attach="OffersList_Menu_ShareTwitter($dataContext)"/>
                        </ContextMenu>
                    </FlowDocumentScrollViewer.ContextMenu>
                </FlowDocumentScrollViewer>
                
                <TextBox Grid.Row="6" Text="{Binding OfferNegativ}" Foreground="#FF000000" FontSize="20" FontWeight="Bold" Margin="20, 0, 20, 0" />
                <FlowDocumentScrollViewer Grid.Row="7" Name="FDOfferPositiv"
                                          Document="{Binding Path=CurrentJobOffer.Positivism, Converter={StaticResource HTMLtoFDConverter}}"
                                          Foreground="#FF000000" FontSize="24" BorderBrush="Transparent" BorderThickness="0" Margin="0">
                    <FlowDocumentScrollViewer.ContextMenu>
                        <ContextMenu>
                            <MenuItem Header="{x:Static properties:Resources.ctxmenu_Copy}" Command="Copy"/>
                            <MenuItem Header="{x:Static properties:Resources.ctxmenu_SendMessage}"
                                      cal:Message.Attach="OffersList_Menu_Message()"/>
                            <Separator />
                            <MenuItem Header="{x:Static properties:Resources.share_Facebook}"
                                              cal:Message.Attach="OffersList_Menu_ShareFacebook($dataContext)"/>
                            <MenuItem Header="{x:Static properties:Resources.share_Twitter}"
                                              cal:Message.Attach="OffersList_Menu_ShareTwitter($dataContext)"/>
                        </ContextMenu>
                    </FlowDocumentScrollViewer.ContextMenu>
                </FlowDocumentScrollViewer>
            </Grid>
        </ScrollViewer>
    </mah:MetroContentControl>

</UserControl>
